import type { PaginationProps } from "element-plus";
import { i18n } from "@/i18n";

export const pageSizeOptions = [10, 20, 50,100,200,500,1000,2000,5000,10000,20000]

export const getPaginationProps = ()=>{
  const res = {
    currentPage: 1,
    pageSize: 10,
    pageSizes: pageSizeOptions,
    layout: "total, sizes, prev, pager, next, jumper",
  }
  return res
}

export const getTimeTypeOptions = ()=>{
  const i18nObj = i18n.global
  const res = [
    {val: 0, label: i18nObj.t('time.byTimeRange')},
    {val: 1, label: i18nObj.t('time.byRecentTime')},
  ]
  return res
}

//最近时间
export const getTimeRecentOptions = ()=>{
  const i18nObj = i18n.global
  //val 为秒
  const res = [
    {val: 60, label: i18nObj.t('time.recent1min')},
    {val: 60*10, label: i18nObj.t('time.recent10min')},
    {val: 60*30, label: i18nObj.t('time.recent30min')},
    {val: 3600, label: i18nObj.t('time.recent1hour')},
    {val: 3600 * 3, label: i18nObj.t('time.recent3hour')},
    {val: 3600 * 12, label: i18nObj.t('time.recent12hour')},
    {val: 3600 * 24, label: i18nObj.t('time.recent1day')},
    {val: 3600 * 24 * 7, label: i18nObj.t('time.recent7day')},
  ]
  return res
}
